import React from "react";
import { Linking, StyleSheet, View } from "react-native";
import Header from "../../widgets/Header";

export default ({navigation})=>{

    const {weburl,title} = navigation.state.params

    console.log('weburl:' + weburl)

    const onShouldStartLoadWithRequest = (request)=>{
        if(!request.url.startsWith('http'))
        {
            Linking.openURL(request.url).catch(er => {
                console.log("Failed to open Link: " + er.message);
            });
            return false;
        }
        return true;
    }
    return (
        <View style={styles.container}>
            <Header title={title} navigation={navigation}/>
          {/*
            <WebView
                originWhitelist={['*']}
                allowFileAccess={true}
                disableTouchHideKeyboard={true}
                source={{uri:weburl}}
                startInLoadingState={true}
                onShouldStartLoadWithRequest={onShouldStartLoadWithRequest}
            />
            */}



        </View>
    )
}

const styles= StyleSheet.create({
    container:{
        flex:1
    }
})
